﻿<Application x:Class="ImoutoDesktop.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="clr-namespace:ImoutoDesktop"
    xmlns:ii="clr-namespace:ImoutoDesktop.Input"
    xmlns:io="clr-namespace:ImoutoDesktop.IO"
    ShutdownMode="OnExplicitShutdown" Startup="App_Startup" Exit="App_Exit">
    <Application.Resources>

        <ContextMenu x:Key="ContextMenuKey">
            <MenuItem Header="キャラクタ(_I)" ItemsSource="{x:Static io:CharacterManager.Characters}">
                <MenuItem.ItemContainerStyle>
                    <Style TargetType="{x:Type MenuItem}">
                        <Setter Property="IsEnabled" Value="{Binding Path=Value.CanSelect}" />
                        <Setter Property="Command" Value="{x:Static ii:Commands.Character}" />
                        <Setter Property="CommandParameter" Value="{Binding Path=Key}" />
                    </Style>
                </MenuItem.ItemContainerStyle>
                <MenuItem.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Path=Value.Name}" />
                    </DataTemplate>
                </MenuItem.ItemTemplate>
            </MenuItem>
            <MenuItem Header="吹き出し(_B)" ItemsSource="{x:Static io:BalloonManager.Balloons}">
                <MenuItem.ItemContainerStyle>
                    <Style TargetType="{x:Type MenuItem}">
                        <Setter Property="IsEnabled" Value="{Binding Path=Value.CanSelect}" />
                        <Setter Property="Command" Value="{x:Static ii:Commands.Balloon}" />
                        <Setter Property="CommandParameter" Value="{Binding Path=Key}" />
                    </Style>
                </MenuItem.ItemContainerStyle>
                <MenuItem.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Path=Value.Name}" />
                    </DataTemplate>
                </MenuItem.ItemTemplate>
            </MenuItem>
            <Separator />
            <MenuItem Header="機能(_F)">
                <MenuItem Header="常に前面に表示(_T)" IsCheckable="True"
                          IsChecked="{Binding Path=Topmost, Source={x:Static i:Settings.Default}}" />
                <Separator />
                <MenuItem Header="オプション(_O)" Command="ii:Commands.Option" />
            </MenuItem>
            <Separator />
            <MenuItem Header="バージョン情報(_V)" Command="ii:Commands.Version"/>
            <Separator />
            <MenuItem Header="閉じる(_C)" Command="ApplicationCommands.Close" />
        </ContextMenu>
        
        <Style x:Key="ImoutoWindowStyleKey" TargetType="{x:Type Window}">
            <Setter Property="AllowsTransparency" Value="True"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="WindowStyle" Value="None"/>
            <Setter Property="ShowInTaskbar" Value="False"/>
            <Setter Property="SizeToContent" Value="WidthAndHeight"/>
            <Setter Property="ContextMenu" Value="{StaticResource ContextMenuKey}"/>
        </Style>

    </Application.Resources>
</Application>
